import React, { Component } from 'react'


// 购物车组件
import Cart from './pages/Cart'
import Cmp1 from './pages/Cmp1'

import Sub from './components/Sub'
import Cmp2fun from './pages/Cmp2fun'
import Cmp2class from './pages/Cmp2class'
// import User from './pages/User'
// import User2 from './pages/User2'
import User3 from './pages/User3'

export default class App extends Component {
  state = {
    cnt: '中午去吃饭，xxx好的'
  }
  render() {
    return (
      <div>
        {/* 购物车组件 显示组件 */}
        <Cart />
        {/* props.children 获取组件内中的数据 插槽 slot */}
        <Cmp1>
          {this.state.cnt}
          {/* <Sub />
          {this.state.username} */}
        </Cmp1>
        <hr />
        {/* <Cmp2fun a={1} b={2} /> */}
        {/* 默认值 如要传入值，则传入的值为主，默认值为辅 */}
        <Cmp2fun a={1} />
        <Cmp2class a={1} b={2} />
        <hr/>
        {/* <User /> */}
        {/* <User2 /> */}
        <User3 />

      </div>
    )
  }
}
